<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>ECharts</title>
    <!-- 引入 echarts.js -->
    <!-- <script src="http://cdn.bootcss.com/echarts/3.2.2/echarts.common.js"></script> -->
    <script src="https://cdn.bootcss.com/echarts/4.2.1-rc1/echarts-en.common.js"></script>
</head>
<body>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="main" style="width:100px;height:100px"></div>
    <script type="text/javascript">
       var mydiv = document.getElementById("main");
        mydiv.style.width = window.innerWidth  + "px";
        mydiv.style.height = window.innerHeight + "px";
        var myChart = echarts.init(document.getElementById('main'));
    </script>
</body>
</html>